﻿@using Microsoft.AspNet.Identity
@using HelpInfo.GetMsWeb.Models

@model HelpInfo.GetMsWeb.Models.ManageUserViewModel

@{
    progetEntities db = new progetEntities();
    Agent currentUser = db.Agents.SingleOrDefault(user => user.Matricule == User.Identity.Name);
    if (currentUser == null)
    {
        <p>Vous êtes connecté en tant que <strong>@User.Identity.GetUserName()</strong>.</p>
    }
    else
    {
        <p>Vous êtes connecté en tant que <strong>@currentUser.Nom @currentUser.Prénom, Matricule = @currentUser.Matricule</strong>.</p>
    }
}


@using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
    @Html.AntiForgeryToken()
    <h4>Formulaire de modification du mot de passe</h4>
    <hr />
    @Html.ValidationSummary()
    <div class="form-group">
        @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" value="Modifier le mot de passe" class="btn btn-default" />
        </div>
    </div>
}
